plot_conjoint <- function(data, format = "full", numbers = FALSE){
  
  if(format == "full"){
    if(numbers == FALSE){
      data %>% 
        ggplot(aes(x = estimate, y = fct_rev(level) , xmin = lower, xmax = upper, col = feature)) +
        geom_vline(xintercept = 0) +
        geom_point(size = 4) +
        geom_errorbar(width = 0, size = 1) +
        labs(y = "",
             x = "Estimated AMCE") +
        scale_x_continuous(breaks = c(-.3, -.2, -.1, 0, .1, .2, .3),
                           limits = c(-.28, .30)) +
        theme_cjoint()
    }
    else if(numbers == TRUE){
      data %>% 
        mutate(
          label = ifelse(
            estimate != 0,
            paste0(round(estimate,3), " [", round(lower,3), ",", round(upper,3),"]"),
            NA
          )
        ) %>% 
        ggplot(aes(x = estimate, y = fct_rev(level) , 
                   xmin = lower, xmax = upper, col = feature, label = label)) +
        geom_vline(xintercept = 0) +
        geom_point(size = 4) +
        geom_errorbar(width = 0, size = 1) +
        geom_label_repel(size = 3) +
        labs(y = "",
             x = "Estimated AMCE") +
        scale_x_continuous(breaks = c(-.3, -.2, -.1, 0, .1, .2, .3),
                           limits = c(-.28, .30)) +
        theme_cjoint()
    }
  }
  
  else if(format == "partial"){
    if(numbers == FALSE){
      data %>% 
        filter((feature %in% c("Legislative checks", "Judicial checks", "Lockdown policy")) |
                 (level %in% c("Legislative checks:", "Judicial checks:", "Lockdown policy:"))) %>% 
        ggplot(aes(x = estimate, y = fct_rev(level) , xmin = lower, xmax = upper, 
                   col = feature, shape = feature)) +
        geom_vline(xintercept = 0) +
        geom_point(size = 4) +
        geom_errorbar(width = 0, size = 1) +
        labs(y = "",
             x = "Estimated AMCE") +
        scale_x_continuous(breaks = c(-.3, -.2, -.1, 0, .1, .2, .3),
                           limits = c(-.28, .30)) +
        theme_cjoint()
    }
    else if(numbers == TRUE){
      data %>% 
        filter((feature %in% c("Legislative checks", "Judicial checks", "Lockdown policy")) |
                 (level %in% c("Legislative checks:", "Judicial checks:", "Lockdown policy:"))) %>% 
        mutate(
          label = ifelse(
            estimate != 0,
            paste0(round(estimate,3), " [", round(lower,3), ",", round(upper,3),"]"),
            NA
          )
        ) %>% 
        ggplot(aes(x = estimate, y = fct_rev(level) , 
                   xmin = lower, xmax = upper, col = feature, label = label)) +
        geom_vline(xintercept = 0) +
        geom_point(size = 4) +
        geom_errorbar(width = 0, size = 1) +
        geom_label_repel(size = 3) +
        labs(y = "",
             x = "Estimated AMCE") +
        scale_x_continuous(breaks = c(-.3, -.2, -.1, 0, .1, .2, .3),
                           limits = c(-.28, .30)) +
        theme_cjoint()
    }
  }
  
}